package vue.popup;

import java.awt.Dimension;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;

import controleur.ControllerAdmin;

public class PopupLogin extends JFrame 
{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private ControllerAdmin control;
	private JTextField tf_login;
	private JTextField tf_pass;
	public PopupLogin(ControllerAdmin p_control) 
	{
		control = p_control;
		this.setLocationRelativeTo(null);
		this.setResizable(true);
		this.setVisible(true);
		this.setTitle("Authentication");
		this.setMinimumSize(new Dimension(300,200));
		
		getContentPane().setLayout(null);
		
		tf_login = new JTextField();
		tf_login.setBounds(104, 21, 121, 20);
		getContentPane().add(tf_login);
		tf_login.setColumns(10);
		
		tf_pass = new JTextField();
		tf_pass.setBounds(104, 52, 121, 20);
		getContentPane().add(tf_pass);
		tf_pass.setColumns(10);
		
		JLabel lblLogin = new JLabel("Login :");
		lblLogin.setBounds(45, 24, 46, 14);
		getContentPane().add(lblLogin);
		
		JLabel lblPassword = new JLabel("Password :");
		lblPassword.setBounds(45, 55, 65, 14);
		getContentPane().add(lblPassword);
		
		JButton btnLogin = new JButton("Login");
		btnLogin.addActionListener(control);
		btnLogin.setBounds(21, 122, 89, 23);
		getContentPane().add(btnLogin);
		
		JButton btnCancel = new JButton("Cancel");
		btnCancel.addActionListener(control);
		btnCancel.setBounds(167, 122, 89, 23);
		getContentPane().add(btnCancel);
	}
}
